#ifndef __DXMESH_H__
#define __DXMESH_H__

#include "Mesh.h"
#include <D3dx9mesh.h>
#include <vector>
#include <boost/smart_ptr/shared_ptr.hpp>


// Use this class only if the DirectX engine is initialized
// Else no D3D device can be used to load mesh

class CDXTexture;

class CDXMesh : public CMesh
{
public:
	CDXMesh() : m_pMesh(0)
	{}

	virtual ~CDXMesh();
	virtual void load(const char *szFileName);
	virtual void update()
	{}
	virtual void render();

private:
	LPD3DXMESH					m_pMesh;
	std::vector<CDXTexture*>	m_pTextures;

	HRESULT	loadTexture(const char* pTexFile);
	void	freeTextures();
};
typedef boost::shared_ptr<CMesh> DXMeshPtr;


#endif // __DXMESH_H__